using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using DataTools.PagingUtils;

namespace AccessLayer
{
    abstract class DataProvider
    {
        #region Fields
        static DataProvider _Instance;        
        static object _Clock = new object();
        #endregion  


        #region Methods
        public static DataProvider getInstance()
        {
            if (_Instance == null)
            {
                lock (_Clock)
                {                  
                    return new SqlProvider();                    
                }
            }
            return _Instance;
        }
        
        public abstract IDataReader getAll(object tableName, string orderBy);     
        public abstract IDataReader Find(object tableName, object columnName, object key);        
        public abstract int InsertUpdateDelete(ProviderAction action, string spName, string outPutName, params object[] parameterValues);
        public abstract IDataReader ExecuteReader(string spName, params object[] parameterValues);
        public abstract int ExecuteNonQuery(string spName, params object[] parameterValues);
        #endregion
    }
}
